<?php

// No direct access to this file
defined('_JEXEC') or die('Restricted access');
class BakerysViewOrders extends JViewLegacy
{
	protected $items;
	protected $pagination;
	protected $state;
	
	public function display($tpl = null) 
	{
		$this->state = $this->get('State');
		$this->items = $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		BakerysHelper::addSubmenu('orders');
		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}
		
		$this->addToolBar();
		$this->sidebar = JHtmlSidebar::render();
		parent::display($tpl);
	
	}

	protected function addToolBar() 
	{
		require_once JPATH_COMPONENT.'/helpers/bakerys.php';
		$state	= $this->get('State');
	
		$canDo	= BakerysHelper::getActions($state->get('filter.id'));
		JToolbarHelper::title(JText::_('COM_BAKERYS_ITEMS'));

		
		
	}	
}
